#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "mainform.h"
#include "UploadForm.h"
#include "answerform.h"
#include <QLayout>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_pushButton_clicked();

    void on_label_linkActivated(const QString &link);

protected:
    void paintEvent(QPaintEvent *);

private:
    Ui::MainWindow *ui;
    MainForm *m_pMainForm;
    UploadForm *m_pUploadForm;
    AnswerForm *m_pAnswerForm;
QTimer *timer;
    void clearLayout(QLayout *pLayout)
        {
            //清空horizontalLayout布局内的所有元素
            QLayoutItem *child;
            while ((child = pLayout->takeAt(0)) != 0)
            {
                if(child->widget())
                {
                    child->widget()->setParent(NULL);
                }
            }
        }
};
#endif // MAINWINDOW_H
